package org.clipjoint.dao;

import org.clipjoint.entity.Purchased;
import org.clipjoint.entity.User;
import org.clipjoint.entity.Dream;

import java.sql.SQLException;
import java.util.List;

public interface UserDao {

    // 插入一条user数据
    int insert(User user) throws SQLException;

    // 查询邮箱是否重复注册
    User selectByEmail(User user) throws SQLException;

    //根据邮箱和密码查询
    User selectByEmailAndPassword(User user) throws SQLException;

    //更新用户数据
    int update(User user) throws SQLException;

    List<Dream> dream(Long id) throws SQLException;

    List<Purchased> purchased(Long id) throws SQLException;

}
